//
//  Emoticons.swift
//  表情键盘
//
//  Created by 焦林生 on 15/11/15.
//  Copyright © 2015年 焦林生. All rights reserved.
//

import UIKit
//MARK: - 表情模型
class Emoticons: NSObject {

    //表情文字
    var chs: String?
    
    //表情图片
    var png: String?
    
    //emoji 的字符编码
    var code: String? {
    
        didSet {
        
            emoji = code?.emoji
        }
    }
    
    //图像完整路径
    var imagePath: String {
    
        //判断是否有图片
        if png == nil {
        
            return ""
        }
        
        //拼接完整的路径
        //print(png)
        return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
       
    }
    //emoji 的字符串
    var emoji: String?
    
    //是否删除按钮标记
    var isRemoved = false
    
    //是否空白按钮标记
    var isEmpty = false
    
    //MARK: 构造函数
    init(isEmpty: Bool) {
        self.isEmpty = isEmpty
    }
    
    init(isRemoved: Bool) {
        self.isRemoved = isRemoved
    }
    
    init(dict: [String: AnyObject]) {
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {

    }
    
    override var description: String {
    
        let keys = ["chs", "png", "code", "isRemoved"]
        
        return dictionaryWithValuesForKeys(keys).description
    }
    
    
    
    
    
    
}
